package com.wz.project.cxtj.outOrder.service.impl;

import com.wz.common.utils.DateUtils;
import com.wz.common.utils.text.Convert;
import com.wz.project.cxtj.outOrder.domain.ViewOutOrder;
import com.wz.project.cxtj.outOrder.mapper.ViewOutOrderMapper;
import com.wz.project.cxtj.outOrder.service.IViewOutOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 出库流水Service业务层处理
 * 
 * @author wz
 * @date 2022-05-19
 */
@Service
public class ViewOutOrderServiceImpl implements IViewOutOrderService 
{
    @Autowired
    private ViewOutOrderMapper viewOutOrderMapper;

    /**
     * 查询出库流水
     * 
     * @param jobId 出库流水ID
     * @return 出库流水
     */
    @Override
    public ViewOutOrder selectViewOutOrderById(String jobId)
    {
        return viewOutOrderMapper.selectViewOutOrderById(jobId);
    }

    /**
     * 查询出库流水列表
     * 
     * @param viewOutOrder 出库流水
     * @return 出库流水
     */
    @Override
    public List<ViewOutOrder> selectViewOutOrderList(ViewOutOrder viewOutOrder)
    {
        return viewOutOrderMapper.selectViewOutOrderList(viewOutOrder);
    }

    /**
     * 新增出库流水
     * 
     * @param viewOutOrder 出库流水
     * @return 结果
     */
    @Override
    public int insertViewOutOrder(ViewOutOrder viewOutOrder)
    {
        viewOutOrder.setCreateTime(DateUtils.getNowDate());
        return viewOutOrderMapper.insertViewOutOrder(viewOutOrder);
    }

    /**
     * 修改出库流水
     * 
     * @param viewOutOrder 出库流水
     * @return 结果
     */
    @Override
    public int updateViewOutOrder(ViewOutOrder viewOutOrder)
    {
        return viewOutOrderMapper.updateViewOutOrder(viewOutOrder);
    }

    /**
     * 删除出库流水对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteViewOutOrderByIds(String ids)
    {
        return viewOutOrderMapper.deleteViewOutOrderByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除出库流水信息
     * 
     * @param jobId 出库流水ID
     * @return 结果
     */
    @Override
    public int deleteViewOutOrderById(String jobId)
    {
        return viewOutOrderMapper.deleteViewOutOrderById(jobId);
    }
}
